﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucListSanPham.ascx.cs" Inherits="Admin_ucControl_ucListSanPham" %>
<script type="text/javascript">
    function s() {
        var t = document.getElementById("<%=grdItems.ClientID%>");
        var t2 = t.cloneNode(true)
        for (i = t2.rows.length - 1; i > 0; i--)
            t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s
</script>

<div id="center-column">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    <div id="table-content">
        <h1>
            Danh Sách Sản Phẩm
        </h1>
        <br />
        <table class="style1">
            <tr>
                <td>
                    <asp:HyperLink ID="hypeAddnew" runat="server" NavigateUrl="~/Admin/ThemSanPham.aspx"
                        Text="Thêm mới sản phẩm" Font-Size="Medium"></asp:HyperLink>
                </td>
            </tr>
        </table>
        <br />
        <br />
        <div id="message-blue" style="display: none">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="blue-left">
                        Welcome back. <a href="">View my account.</a>
                    </td>
                    <td class="blue-right">
                        <a class="close-blue">
                            <img src="images/table/icon_close_blue.gif" alt="" /></a>
                    </td>
                </tr>
            </table>
        </div>
        <asp:Button ID="btnDel" runat="server" Text="Xoá" OnClick="btnDel_Click" />
        <div>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <div id="a">
                        </div>
                        <div style="overflow-y: scroll; height: 360px">
                            <asp:GridView ID="grdItems" runat="server" AutoGenerateColumns="False" Width="650px"
                                CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True"
                                OnRowDataBound="grdItems_RowDataBound" 
                                onpageindexchanging="grdItems_PageIndexChanging">
                                <RowStyle BackColor="#E3EAEB" Height="30px" />
                                <Columns>
                                    <asp:TemplateField HeaderText="#">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="ckDel" runat="server" />
                                            <asp:HiddenField ID="hidItemID" runat="server" />
                                        </ItemTemplate>
                                        <HeaderStyle Width="7%" HorizontalAlign="Center" />
                                        <ItemStyle Width="7%" HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="ItemID" HeaderText="ID" FooterStyle-HorizontalAlign="Center" FooterStyle-Width="8%" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="8%" />
                                    
                                    <asp:HyperLinkField DataNavigateUrlFields="ItemID" DataNavigateUrlFormatString="~/Admin/ThemSanPham.aspx?id={0}"
                                        DataTextField="ItemName" HeaderText="Tên Sản Phẩm">
                                        <HeaderStyle Width="45%" HorizontalAlign="Center" />
                                        <ItemStyle Width="45%" HorizontalAlign="Center" />
                                    </asp:HyperLinkField>
                                    <asp:BoundField DataField="TypeName" HeaderText="Thuộc  Loại ">
                                        <HeaderStyle HorizontalAlign="Center" Width="20%" />
                                        <ItemStyle HorizontalAlign="Center" Width="20%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Price" HeaderText="Giá">
                                        <HeaderStyle HorizontalAlign="Center" Width="20%" />
                                        <ItemStyle HorizontalAlign="Center" Width="20%" />
                                    </asp:BoundField>
                                </Columns>
                                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="clsPage" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#2e74b2" Font-Bold="True" ForeColor="White" Height="35px" />
                                <EditRowStyle BackColor="#7C6F57" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
